#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSettings>
#include <QLineEdit>

QT_BEGIN_NAMESPACE
namespace Ui
{
    class MainWindow;
}
QT_END_NAMESPACE


enum class PathKind{
    GrammarPath,
    BaseHpp,
    DerivedHpp,
    DerivedCpp,
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    static QString getPath(PathKind kind);
    static void setPath(PathKind kind ,const QString& value);

protected:
    bool eventFilter(QObject *watched, QEvent *event);

private:
    Ui::MainWindow *ui;
    static std::unique_ptr<QSettings> setting_;
    static std::unordered_map<QLineEdit*,PathKind> routing_;
    bool autoWriteToFile_ = true;
    void generateBaseVisitor();
    void generateVisitor();
    void setAutoSaveToFile(bool enable);
    bool autoSaveToFile() const;

};
#endif // MAINWINDOW_H
